package com.inga.httpclient;

import com.inga.httpclient.common.Constant;
import com.inga.httpclient.utils.HttpUtils;
import com.inga.httpclient.utils.RequestHttpService;
import org.apache.http.HttpResponse;

import java.io.IOException;

/**
 * Created by abing on 2015/10/22.
 */
public class AppDaoMu {

//    static  RequestHttpService  service;
//
//    static {
//        service = new RequestHttpService();
//    }

//    public HttpResponse getGetRequest(){
//
//        HttpResponse response = null;
//        try {
//            response = service.getHttpRequest(Constant.INDEX_URL , null);
//
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//
//        return response;
//    }



    public static void main(String[] args){

//        AppDaoMu app = new AppDaoMu();
//        app.getGetRequest();

        HttpUtils utils = new HttpUtils();
        RequestHttpService service = new RequestHttpService();
        HttpResponse response = null;
        try {
            response = service.getHttpRequest(Constant.INDEX_URL , null);

            String indeHtml = utils.httpResponseToString(response);

            System.out.println(indeHtml);

        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
